package grg.learn.compose.ui.models

import android.util.Log
import androidx.compose.runtime.collectAsState
import androidx.compose.runtime.mutableStateListOf
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.Transformations
import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.async
import kotlinx.coroutines.delay
import kotlinx.coroutines.flow.*
import kotlinx.coroutines.launch


class MainListVM : ViewModel() {

    /** 默认0页 **/
    val params = MutableStateFlow<Int>(0)
//    val datas2 =  MutableSharedFlow<List<String>>()

    val datas2 = params.flatMapConcat {
        println(it)
        flow<List<String>> {
            emit(listOf("$it"))
        }
    }

}
